<div class="card">

    <div class="portlet">
        <form class="portlet-search-body" name="queryForm">
            <input type="text" class="form-control search-item" ng-model="orderId" placeholder="制作单编号">
            <div class="search-item">
                <button class="btn btn-icon-only default"><i class="fa fa-chevron-right"></i></button>
                <button class="btn btn-sm query" ng-click="grid.query();"><i class="fa fa-search"></i> 查询</button>
                <button class="btn btn-sm reset" ng-click="grid.reset();"><i class="fa fa-eraser"></i> 重置</button>
            </div>
        </form>
        <div class="card-header" style="padding-left: 5px;">
            <h4>制作单列表</h4>
        </div>
        <div class="portlet-body">
            <table ed-grid="grid" id="table1" class="table table-striped table-bordered table-advance table-hover"
                   data-options="url: 'order/query.do'">
                <thead>
                <tr>
                    <th data-options="field: '_index'"></th>
                    <th data-options="field: 'orderId'" style="width: 27%;">制作单编号</th>
                    <th data-options="field: 'customerName'" style="width: 30%;">客户</th>
                    <th data-options="field: 'recordTime | limitTo : 10'" style="width: 15%;">日期</th>
                    <th data-options="field: 'status | code : order_status'" style="width: 10%;">状态</th>
                    <th data-options="field: 'finishTime | limitTo : 10'" style="width: 15%;">完工日期</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
<div class="card">
    <div class="portlet-actions" style="float: right;margin-right: 5px;margin-bottom: 7px;">
        <button class="btn blue btn-sm" ng-click="reimburseGrid.add()"><i class="fa fa-plus"></i> 新增</button>
    </div>
    <div class="card-header" style="padding-left: 5px;">
        <h4>报销列表</h4>
    </div>

    <div class="portlet" ng-show="showReimburseFlag">
        <div class="portlet-body">
            <table ed-grid="reimburseGrid"  class="table table-striped table-bordered table-advance table-hover"
                   data-options="url: 'reimburseBill/query.do', modelText: 'xx列表', form: 'queryForm', modal: 'modal'">
                <thead>
                <tr>
                    <th data-options="field: '_index'"></th>
                    <th data-options="field: 'reimburseUsage'">用途</th>
                    <th data-options="field: 'reimburseType | code : reimburse_type'">分类</th>
                    <th data-options="field: 'reimburseCount'">数量</th>
                    <th data-options="field: 'totalAmount'">总额(￥)</th>
                    <th data-options="field: 'deptName'">申请部门</th>
                    <th data-options="field: 'empName'">报销人</th>
                    <th data-options="field: 'status | code : reimburse_status'">状态</th>
                    <th style="min-width: 180px;">操作</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>

<div ed-modal="modal" data-options="title: '报销明细', static: true, width: 720, defaultButton:false,onHidden:'reset'">

    <form action="#" class="form-horizontal w5c-form" w5c-form-validate novalidate name="validateForm">
        <div class="form-body">
        	<div class="form-group">
				<label class="col-md-2 control-label">用途</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="reimburseUsage" ng-model="reimburseBill.reimburseUsage" required>
            	</div>
                <label class="col-md-2 control-label">分类</label>
                <div class="col-md-4">
                    <select style="color: gray;" class="form-control" name="reimburseType" ng-model="reimburseBill.reimburseType"
                            ng-options="opt.value as opt.name for opt in options.reimburse_type" required>
                        <option value="" disabled selected hidden>-- 分类 --</option>
                    </select>
                </div>
            </div>
        	<div class="form-group">
				<label class="col-md-2 control-label">数量</label>
				<div class="col-md-4">
					<input type="text" class="form-control" name="reimburseCount" ng-model="reimburseBill.reimburseCount" ed-validate="integer" required>
            	</div>
                <label class="col-md-2 control-label">总额</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="totalAmount" ng-model="reimburseBill.totalAmount" required>
                </div>
            </div>
        	<div class="form-group">
				<label class="col-md-2 control-label">申请部门</label>
				<div class="col-md-4">
                    <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId'"
                         ng-model="reimburseBill.deptId" ed-data="depts" placeholder="申请部门"  name="deptId" required></div>
            	</div>
                <label class="col-md-2 control-label">报销人</label>
                <div class="col-md-4">
                    <div ed-combotree name="member" class="empListDiv" placeholder="报销人"
                         data-options="idField: 'id', textField: 'name', parentIdField: 'parentId'"
                         ng-model="reimburseBill.id" ed-selectable="selectable(data)" ed-data="empList" required></div>
                </div>
            </div>
        </div>
        <div class="form-actions">
            <button type="button" class="btn default" ng-click="reimburseGrid.cancel();">
                <i class="fa fa-times"></i> 取消
            </button>
            <button type="button" class="btn blue" ng-click="reimburseGrid.save();">
                <i class="fa fa-times"></i> 确定
            </button>
        </div>
    </form>
</div>

<div ed-modal="viewModal" data-options="title: '报销明细', static: true, width: 720, defaultButton:false">

    <form action="#" class="form-horizontal w5c-form" w5c-form-validate novalidate name="validateForm">
        <div class="form-body">
            <div class="form-group">
                <label class="col-md-2 control-label">用途:</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.reimburseUsage}}
                </div>
                <label class="col-md-2 control-label">分类:</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.reimburseType | code : 'reimburse_type'}}
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">数量:</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.reimburseCount}}
                </div>
                <label class="col-md-2 control-label">总额(￥):</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.totalAmount}}
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">申请部门:</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.deptName}}
                </div>
                <label class="col-md-2 control-label">报销人:</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.empName}}
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">状态:</label>
                <div class="col-md-4" style="margin-top: 9px;">
                    {{reimburseView.status | code : 'reimburse_status'}}
                </div>
            </div>
        </div>
        <div class="form-actions">
            <button type="button" class="btn blue" ng-click="sure()">
                <i class="fa fa-times"></i> 确定
            </button>
        </div>
    </form>
</div>
